#[derive(Debug)]
pub struct Shader {
    path:   &'static str,
    shader: wgpu::ShaderModule,
}

impl Shader {
    pub fn new(device: &wgpu::Device, shader_path: &'static str, label:Option<&'static str>) -> Self {
        let path = std::fs::read_to_string(shader_path).unwrap();
        let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
            label,
            source: wgpu::ShaderSource::Wgsl(path.into()),
        });

        Self {
            path:shader_path,
            shader,
        }
    }

    pub fn get_module(&self) -> &wgpu::ShaderModule {
        &self.shader
    }

    pub fn get_path(&self) -> &'static str {
        &self.path
    }
}
